﻿Imports AccesoDatos

Public Class MultiRol

#Region "Elías Baldioceda"
    ''' <summary>
    ''' Devuelve todos los roles del sistema.
    ''' </summary>
    ''' <returns>Todos los roles.</returns>
    ''' <remarks>Creado por: Elías Baldioceda, Fecha: 20/06/2010, Modificado: 20/06/2010</remarks>
    Public Shared Function buscar() As List(Of Hashtable)
        Dim sql As String
        Dim pars(0) As Parametro
        Dim data As IDataReader
        Dim rol As Hashtable
        Dim roles As New List(Of Hashtable)

        sql = "SELECT * FROM t_rol"
        pars(0) = New Parametro("p_identificacion", "")

        data = g_access.ejecutarQuery(sql, pars)

        While data.Read()
            rol = New Hashtable
            rol.Add("descripcion", data.Item("descripcion"))
            rol.Add("id", data.Item("id"))
            roles.Add(rol)
        End While

        Return roles
    End Function
#End Region

End Class
